package cn.liontalk.springboot_es.controller;


import cn.liontalk.springboot_es.entity.MySqlBlog;
import cn.liontalk.springboot_es.repository.mysql.MySqlBlogRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@Slf4j
public class IndexController {


    @Autowired
    MySqlBlogRepository mySqlBlogRepository;


    @RequestMapping("/")
    public String index(){
        List<MySqlBlog> blogList= mySqlBlogRepository.findAll();
        log.info("==============>blogList size == {}",blogList.size());
        return "index.html";
    }


}
